# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Docs.V1.Model.TableRow do
  @moduledoc """
  The contents and style of a row in a Table.

  ## Attributes

  *   `endIndex` (*type:* `integer()`, *default:* `nil`) - The zero-based end index of this row, exclusive, in UTF-16 code units.
  *   `startIndex` (*type:* `integer()`, *default:* `nil`) - The zero-based start index of this row, in UTF-16 code units.
  *   `suggestedDeletionIds` (*type:* `list(String.t)`, *default:* `nil`) - The suggested deletion IDs. If empty, then there are no suggested deletions of this content.
  *   `suggestedInsertionIds` (*type:* `list(String.t)`, *default:* `nil`) - The suggested insertion IDs. A TableRow may have multiple insertion IDs if it's a nested suggested change. If empty, then this is not a suggested insertion.
  *   `suggestedTableRowStyleChanges` (*type:* `%{optional(String.t) => GoogleApi.Docs.V1.Model.SuggestedTableRowStyle.t}`, *default:* `nil`) - The suggested style changes to this row, keyed by suggestion ID.
  *   `tableCells` (*type:* `list(GoogleApi.Docs.V1.Model.TableCell.t)`, *default:* `nil`) - The contents and style of each cell in this row. It's possible for a table to be non-rectangular, so some rows may have a different number of cells than other rows in the same table.
  *   `tableRowStyle` (*type:* `GoogleApi.Docs.V1.Model.TableRowStyle.t`, *default:* `nil`) - The style of the table row.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :endIndex => integer() | nil,
          :startIndex => integer() | nil,
          :suggestedDeletionIds => list(String.t()) | nil,
          :suggestedInsertionIds => list(String.t()) | nil,
          :suggestedTableRowStyleChanges =>
            %{optional(String.t()) => GoogleApi.Docs.V1.Model.SuggestedTableRowStyle.t()} | nil,
          :tableCells => list(GoogleApi.Docs.V1.Model.TableCell.t()) | nil,
          :tableRowStyle => GoogleApi.Docs.V1.Model.TableRowStyle.t() | nil
        }

  field(:endIndex)
  field(:startIndex)
  field(:suggestedDeletionIds, type: :list)
  field(:suggestedInsertionIds, type: :list)

  field(:suggestedTableRowStyleChanges,
    as: GoogleApi.Docs.V1.Model.SuggestedTableRowStyle,
    type: :map
  )

  field(:tableCells, as: GoogleApi.Docs.V1.Model.TableCell, type: :list)
  field(:tableRowStyle, as: GoogleApi.Docs.V1.Model.TableRowStyle)
end

defimpl Poison.Decoder, for: GoogleApi.Docs.V1.Model.TableRow do
  def decode(value, options) do
    GoogleApi.Docs.V1.Model.TableRow.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Docs.V1.Model.TableRow do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
